% Log likelihood function of conditional value distribution,
% for potential sellers with value > screening value (a),
% concentrated at b=u0star 
% ---------------------------------------------- %
function[LL] = sellerLL(theta,PAR,data,b,a)

   if PAR.generalized == 0 %Gaussian, or other two-parameter distribution    
        db  = makedist(PAR.dist,theta(1),theta(2));
        CDF = @(x) cdf(db,x);
        PDF = @(x) pdf(db,x);
  else %Generalized gaussian
        CDF = @(x) ggd_cdf(x,theta);
        PDF = @(x) ggd_pdf(x,theta);
        
        % Support
        %if theta(3)>0
        %    ub = theta(1)+theta(2)/theta(3);
        %    data = data(data.U0hat<ub,:);
        %else
        %    lb = theta(1)+theta(2)/theta(3);
        %    data = data(data.U0hat>lb,:);
        %end
   end
  
  try
        u0trunc     = data.U0hat(data.U0hat<=b&data.U0hat>a);
        likelihood  = PDF(u0trunc)./(CDF(b));
        LL          = -sum(log( likelihood ));
  catch
        LL = Inf;
  end
 
  
end
